<?php
global $id,$page,$pagesize;

$id = isset($_REQUEST['id']) ? trim($_REQUEST['id']): '';
$uid = isset($_REQUEST['uid']) ? trim($_REQUEST['uid']): '';
$table = 'user';
$pagesize = 20;
$user = new User();
switch ($act){
	case 'manage' :
		$mng = $user->manage();
		break;
		
		
	case 'add' :
		if ($submit){
			$data = $_POST['data'];
			$sql = "SELECT * FROM $user->table WHERE UID = $data[uid]";
			$_uid = $user->db->select($sql);
			if ($_uid){
				showmessage('用户已经存在！','');
			}
			$user->db->insert($user->table, $data);
			showmessage('添加成功！','?mod=user');
		}else{
			$add = Array("uid" =>'' ,"uname" =>'' ,"point" =>'');
			break;
		}
		
		
	case 'edit' :
		if ($submit){
			$data = $_POST['data'];
			$user->db->update($user->table, $data);
			showmessage('修改成功！','?mod=user');
		}else{
			$edit = $user->edit();
			break;
		}
		
		
	case 'del' :
		$del = $user->del();
		showmessage('删除成功！','?mod=user');
		break;
		
		
	case 'show' :
		$show = $user->show($uid);
		break;
}

include admintpl($mod.'.'.$act);
?>